<template>
  <van-skeleton>
  <template #template>
    <div :style="{ display: 'flex', width: '100%' }">
      <van-skeleton-image />
      <div :style="{ flex: 1, marginLeft: '16px' }">
        <van-skeleton-paragraph row-width="60%" />
      
      </div>
    </div>
  </template>
</van-skeleton>
<ul>
  <li v-for="item in list" :key="item.id" @click="$router.push('/detail/'+item.id)">
    <div><img :src="item.image" alt=""></div>
    <div>{{ item.title }}</div>
    <div>{{ item.price }}</div>
  </li>
</ul>
</template>

<script setup>
import {ref,onMounted} from 'vue'
import request from '@/tool/request'
const list=ref([])
// pagination, pageNum
const pagination=ref(1)
onMounted(()=>{
  request.get('/list',{
    params:{
      pagination:pagination.value,
      pageNum:40
    }
  }).then(res=>{
    if(res.data.code==200){
      list.value=res.data.data
    }
  })
})
</script>

<style lang="scss" scoped>
ul{
column-count: 2;
column-gap: 10px;
li{
  break-inside: avoid;
  img{
    width: 100%;
  }
}
}
</style>